package edu.stu.cs.software.family.base.service;

import java.io.Serializable;
import java.util.List;

import edu.stu.cs.software.family.base.domain.BaseTreeEntity;

/**
 * The base class is a binary tree
 * @param <T>  a type variable
 * @param <LG> the primary key of long for that type
 
 */
public interface GenericTreeManager<T extends BaseTreeEntity<T, LG>, LG extends Serializable>
		extends GenericManager<T, LG> {

	/**
	 *
	 * @param id ,id code for specified entity
	 * @return  ancestor list
	 */
	public List<T> getAncestors(LG id);

	/**
	 *
	 * @param id, id code for specified entity
	 * @return  children list
	 */
	public List<T> getChildren(LG id);

	/**
	 *
	 * @param id, id code for specified entity
	 * @return all descendants list
	 */
	public List<T> getDescendants(LG id);

	/**
	 *
	 * @return all roots list
	 */
	public List<T> getRoot();

}
